import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; import { getLocale } from "@/lib/i18n/server"; import { href, t } from "@/lib/i18n"; import { getPaper } from "@/lib/papers/queries"; export async function generateMetadata({ params }: { params: Promise<{ id: string }> }): Promise { const { id } = await params; const p = await getPaper(id); return p ? { title: `${p.identifier} · ${p.title} — read`, robots: { index: false } } : {}; } export default async function ReadPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const locale = await getLocale(); const d = t(locale); const p = await getPaper(id); if (!p || !p.has_pdf || !p.file_id) notFound(); const url = `/api/files/${p.file_id}/${p.slug}-${p.version_label ?? "current"}.pdf?inline=1`; return (
← {p.identifier}

{p.title}

{d.paper.download}

{d.paper.readerFallback} {d.paper.download}

); }